<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/10/29
 * Time: 15:39
 */
namespace zhtfrontend\modules\sitepadapi\controllers;

use zhtfrontend\modules\sitepadapi\components\rest\ActiveController;
use yii\web\Response;

class TelcodeController extends ActiveController
{
    public $modelClass = 'common\models\datas\Customer';

    public $serializer = [
        'class' => 'zhtfrontend\modules\sitepadapi\components\rest\Serializer',
        'collectionEnvelope' => 'items',
    ];

    public function behaviors()
    {
        $behaviors = parent::behaviors();
        $behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON;
        return $behaviors;
    }

    public function actions()
    {
        $actions = parent::actions();
        unset($actions['index'], $actions['create'], $actions['update'], $actions['delete'], $actions['view']);
        return $actions;
    }

    public function actionIndex()
    {
        return ['items' => '123456'];
    }

}